declare const x: any;
if (x) {
}

x => !x;

<T extends any>(x: T) => (x ? 1 : 0);